// Our basic **Todo** model has `title`, `order`, and `done` attributes.
Todo.Model.Item = Backbone.Model.extend({

    // Default attributes for the todo item.
    defaults  : function () {
        return {
            "name"       : "Тест",
            "completed"  : false,
            "deleted"    : false,
            "deadline"   : null,
            "expired"    : false,
            "category_id": null,
            "position"   : Todo.items.nextOrder()
        };
    },

    // Ensure that each todo created has `title`.
    initialize: function () {
        if (!this.get("title")) {
            this.set({"title": this.defaults().title});
        }
    },

    // Toggle the `done` state of this todo item.
    toggle    : function () {
        this.save({completed: !this.get("completed")});
    }
});